package com.onesports.intelligent.k12.polarlight.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonValue;
import com.onesports.framework.kit.common.util.ParamUtils;

/**
 * 课表状态枚举类
 * @author wusy
 **/
public enum ScheduleDetailStatusEnum implements IEnum<String> {
    /**
     * 课表状态枚举类
     */
    UN_SPELL("1","未拼班"),
    WAIT_ATTENDANCE("2","待考勤"),
    ATTENDANCE_ING("3","考勤中"),
    ATTENDANCE_ED("4","已考勤"),
    CANCEL("5","作废"),;
    private final String type;
    private final String desc;


    ScheduleDetailStatusEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    @Override
    public String getValue() {
        return this.type;
    }

    @JsonValue
    public String getDesc() {
        return this.desc;
    }

    public ScheduleDetailStatusEnum of() {
        return this;
    }

    public static ScheduleDetailStatusEnum of(String desc) {
        for (ScheduleDetailStatusEnum status : ScheduleDetailStatusEnum.values()) {
            if (ParamUtils.equals(status.desc, desc)) {
                return status;
            }
        }
        return null;
    }
}
